﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;

namespace ARMIR
{
    public class ARMIR_ModSettings : ModSettings
    {
        public static float powerSet = 1.0f;
        public static bool randomFaction;

        // 保存和加载设置
        public override void ExposeData()
        {
            Scribe_Values.Look(ref powerSet, "someValue", 1.0f);
            Scribe_Values.Look(ref randomFaction, "joinRealRandomFaction", false);
            base.ExposeData();
        }
    }

    public class ARMIR_Modset : Mod
    {
        public ARMIR_Modset(ModContentPack content) : base(content)
        {
            GetSettings<ARMIR_ModSettings>();
        }

        // 设置界面显示
        public override void DoSettingsWindowContents(Rect inRect)
        {
            Listing_Standard listingStandard = new Listing_Standard();
            listingStandard.Begin(inRect);

            listingStandard.Label($"数值设置: {ARMIR_ModSettings.powerSet:F1} [建议默认一倍到三倍，其它倍率平衡不确定，不推荐]");
            ARMIR_ModSettings.powerSet = listingStandard.Slider(ARMIR_ModSettings.powerSet, 1, 10);
            listingStandard.Gap();

            listingStandard.CheckboxLabeled("启用迷迭香加入随机派系", ref ARMIR_ModSettings.randomFaction, "迷迭香加入随机阵营\n\n[警告:开启该功能后，迷迭香可能会加入到可能出现问题或者极难对付的派系中去。]");
            listingStandard.Gap();
            //listingStandard.Label($"最大数量: {ARMIR_ModSettings.maxCount}");
            //ARMIR_ModSettings.maxCount = (int)listingStandard.Slider(ARMIR_ModSettings.maxCount, 1, 20);
            //listingStandard.Gap();

            //ARMIR_ModSettings.textSetting = listingStandard.TextEntryLabeled("文本设置", ARMIR_ModSettings.textSetting);
            //listingStandard.Gap();

            listingStandard.End();
            base.DoSettingsWindowContents(inRect);
        }

        // 设置类别名称
        public override string SettingsCategory()
        {
            return "Awc778's Rosmontis In Rimworld";
        }
    }
}
